<?php
Yii::import('system.web.helpers.CHtml');

class MyCHtml extends CHtml
{
	public static function message($data, $type = 'warning', $style="")
	{
        $style = $style == '' ? '' : 'style="'.$style.'"';
		return '<div class="'.$type.'" '.$style.'>'.$data.'</div>';
	}

    public static function flashMessage($name, $type='info')
    {
        if(Yii::app()->user->hasFlash($name))
        {
            $html  = '<div class="'.$type.'">';
            $html .=    Yii::app()->user->getFlash($name);;
            $html .= '</div>';

            return $html;
        }

        return false;
    }
}
